/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pacote;

import java.awt.Container;
import java.awt.HeadlessException;
import javax.swing.JFrame;
import javax.swing.JTable;

/**
 *
 * @author Aluno
 */
public class ExemploTabela extends JFrame {

    private final JTable table;

    public ExemploTabela() throws HeadlessException {
        String[] header = {"Nome", "Idade", "Email"};
        Object[][] data = {
            {"Mikael", new Integer(18), "mkmikael@mkmikael.com"},
            {"Ane", new Integer(20), "ane@ane.com"},
            {"Yan", new Integer(16), "yan@yan.com"},
            {"Guilherme", new Integer(1), "guilherme@guilherme.com"}
        };
        
        table = new JTable(data, header);

        Container container = getContentPane();
        container.add(table);

        this.setSize(500, 300);
        this.setTitle("Table");
        this.setDefaultCloseOperation(EXIT_ON_CLOSE);
        this.setLocationRelativeTo(null);
    }

    public static void main(String[] args) {
        new ExemploTabela().setVisible(true);
    }
}
